package Offer.offer2017;

/**
 * 发散求解1+2+...+ n
 * Created by 雷文康 on 2018/1/6.
 */
public class Test46 {
    public static void main(String[] args) {
        System.out.println(sum(100));
    }
    public static int sum(int n){
        int sum = n;
        boolean flag = n > 0 && (sum += sum(n - 1)) > 0;
        return sum;
    }
}
